# -*- coding:utf-8 -*-
from flask_restful import Resource, reqparse
from models.map_data import MapData


class MapDataApi(Resource):
    """
    MapData
    """

    def get(self):
        """
        根据ID获取地图数据
        :return: 地图数据
        """
        args = reqparse.RequestParser() \
            .add_argument("id", type=str, location="args", required=True, help="参数id不能为空") \
            .parse_args()
        return MapData.query.get(args["id"])

    def delete(self):
        """
        删除
        :return:
        """
        args = reqparse.RequestParser() \
            .add_argument("id", type=str, location="args", required=True, help="参数id不能为空") \
            .parse_args()
        return args["id"]